﻿@model SIGCBI.Entities.DETALLE_PARTIDA

<button type="submit" id="openerP" class="btn btn-default  btn-lg " value="Guardar">Buscar Partida</button>
<p></p>
@using (Html.BeginForm("AsignarPartidaAFuente", "FuenteFinanciera", FormMethod.Post, new { @class = "form-horizontal" }))
{
    <div id="FormAjaxSubmitNotifications"></div>
    
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <div class="panel panel-default">
        <div class="panel-heading"><b>Centro de Costo</b></div>
        <div class="panel-body">
            @Html.DropDownList("cmbCentros")
            <br />
            <br />
            <div class="panel panel-default">
                <div class="panel-heading"><b>Fuente de Financiamiento</b></div>
                <div class="panel-body">

                    <table class="table">
                        <thead>
                            <tr>
                                <th><b>Fuente:</b></th>
                                <th><b>Presupuesto:</b></th>
                                <th><b>Saldo:</b></th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                    @Html.DropDownList("cmbFuentes")
                                    @Html.HiddenFor(model => Model.IdFuenteFinanciera)
                                </td>
                                <td>
                                    <input type="text" readonly="true" id="Presupuesto" name="Presupuesto" />
                                </td>
                                <td>
                                    <b><input type="text" readonly="true" id="Saldo" name="Saldo" class="alert-info" /></b>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    
    <div class="panel panel-default" style="position: inherit; left: auto; top: auto;">
        <div class="panel-heading"><b>Partida Presupuestaria</b></div>
        <div class="panel-body">
            <div class="table-responsive">
                <table class="table">
                    <thead>
                        <tr>
                            <th><b>Partida:</b></th>
                            <th><b>Monto a Asignar:</b></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <input type="text" readonly="true" id="PartidaSeleccionada" name="PartidaSeleccionada" />
                            @Html.HiddenFor(model => Model.IdPartida)
                            <td>
                                @Html.TextBoxFor(model => Model.MontoAsignado, new {@class = "alert-warning"})
                                @Html.ValidationMessageFor(model => model.MontoAsignado)
                                @*@Html.HiddenFor(model => Model.MontoGastado)
                                @Html.HiddenFor(model => Model.Saldo)*@
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
}

<div id="dialogP" class="panel panel-default">
    <div class="panel-heading">Búsqueda de Partida</div>
    <div class="panel-body">
        <b>Criterio :  </b>@Html.TextBox("BuscarPartida")
    </div>
    <div class="panel-footer"></div>
</div>


<p></p>
<p>
    <button type="submit" id="btnGuardar" value="Create" class="btn btn-default btn-lg active">Guardar</button>
    <a href="@Url.Action("Index", "FuenteFinanciera")" class="btn btn-default btn-lg active" role="button">Cancelar</a>
</p>


@section scripts
{
    <script src="~/Scripts/AsignarPartidaAFuente.js" type="text/javascript"></script>

}